package com.neuedu.dao.impl;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


import com.neuedu.dao.TestDao;
import com.neuedu.model.Test;
//把dao接口实现类，交给spring进行管理
@Repository
public class TestDaoImpi implements TestDao {
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}
	@Override
	public int countTest() {
		// TODO Auto-generated method stub
		return  sqlSessionTemplate.getMapper(TestDao.class).countTest();
	}

	@Override
	public List<Test> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(TestDao.class).findAll(map);
	}

}
